package com.ponhu.ea2.goodsCenter.provider.mapper;

import com.ponhu.ea2.entity.PhCategory;
import com.baomidou.mybatisplus.core.mapper.BaseMapper;
import com.ponhu.ea2.vo.PhCategoryLevel3Vo;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * 商品类目表  Mapper 接口
 *
 * @author ${author}
 * @since 2021-10-14
 */
public interface PhCategoryMapper extends BaseMapper<PhCategory> {

    /**
     * 根据一、二、三级类目ID获取所有三级类目集合
     *
     * @param level1CategoryId
     * @param level2CategoryId
     * @param level3CategoryId
     * @return
     */
    List<PhCategoryLevel3Vo> getCategoryLevel3VosById(
            @Param("level1CategoryId") Long level1CategoryId,
            @Param("level2CategoryId") Long level2CategoryId,
            @Param("level3CategoryId") Long level3CategoryId);

    /**
     * 根据三级类目ID集合获取所有三级类目集合
     *
     * @param level3CategoryIds
     * @return
     */
    List<PhCategoryLevel3Vo> getCategoryLevel3VosByIds(
            @Param("level3CategoryIds") List<Long> level3CategoryIds);

    PhCategoryLevel3Vo getCategoryLevel3VosByThirdCategoryId(
            @Param("level3CategoryId") Long level3CategoryId);

    PhCategoryLevel3Vo getCategoryLevel3VosByThirdCategoryName(
            @Param("level3CategoryName") String level3CategoryName);

}
